package com.snopy.designPattern.create.simpleFactory;

import com.snopy.designPattern.create.abstractFactory.AbstractFactory;
import com.snopy.designPattern.create.simpleFactory.impl.Bus;
import com.snopy.designPattern.create.simpleFactory.impl.Jeep;
import com.snopy.designPattern.create.simpleFactory.impl.Suv;

/**
 * @author snopy
 * @version 1.0.0
 * @classname SimpleFactory
 * @description
 * @email 77912204@qq.com
 * @date 2022/03/01 12:14
 */

public class SimpleCarFactory extends AbstractFactory {

    public Car getCar(String carName) {
        Car car = null;
        if (carName.equalsIgnoreCase("BUS")){
            car = new Bus();
        }else if (carName.equalsIgnoreCase("JEEP")){
            car = new Jeep();
        }else if (carName.equalsIgnoreCase("SUV")){
            car = new Suv();
        }
        return car;
    }

    @Override
    public Ship getShip(String shipName) {
        return null;
    }

}
